﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace DeviceMonitor.Utils
{
    [ValueConversion(typeof(string), typeof(string))]
    public class AlermStatusConverter : IValueConverter
    {
        public object Convert(object value, Type typeTarget, object param, CultureInfo culture)
        {
            value = value == null ? "0" : value;
            string strValue = value.ToString();
            switch (strValue)
            {
                case "0":
                    return "报警";
                case "1":
                    return "解除";
                default:
                    return "报警";

            }
        }
        public object ConvertBack(object value, Type typeTarget, object param, CultureInfo culture)
        {
            return "";
        }
    }
}
